package com.example.librarymanagement.dto.book;

import com.example.librarymanagement.entity.Book;
import com.example.librarymanagement.util.BaseDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author zjia
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
public class BookAddDto extends BaseDto<Book> {

    @ApiModelProperty(value = "国际标准书号")
    @NotBlank(message = "ISBN码为空")
    private String isbn;

    @ApiModelProperty(value = "索书名")
    @NotBlank(message = "索书名为空")
    private String callNumber;

    @ApiModelProperty(value = "中文名")
    private String cName;

    @ApiModelProperty(value = "书籍名称")
    @NotBlank(message = "书籍名称为空")
    private String name;

    @ApiModelProperty(value = "作者")
    @NotBlank(message = "书籍作者为空")
    private String author;

    @ApiModelProperty(value = "译者")
    private String translator;

    @ApiModelProperty(value = "类别id")
    @NotNull(message = "书籍类别为空")
    private Integer typeId;

    @ApiModelProperty(value = "语种")
    @NotBlank(message = "书籍语种为空")
    private String languages;

    @ApiModelProperty(value = "出版社")
    @NotBlank(message = "书籍出版社为空")
    private String press;

    @ApiModelProperty(value = "书籍数量")
    @NotNull(message = "书籍数量为空")
    private Integer total;

}
